﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Jalal.Library.Data;
using System.Data.Common;

namespace BCGC.DAL
{
    public class UserData
    {
        public static DataTable GetAdminUserByLoginInfo(string username, string password)
        {
            object id = null;
            DataMiner dataMiner = DataFactory.GetDataMiner();
            DbCommand command = DataFactory.GetCommand();
            command.CommandText = "CSP_GetAdminUserByLoginInfo";
            dataMiner.AddParameter(command, "@SiteUserName", DbType.String, 50, ParameterDirection.Input, username);
            dataMiner.AddParameter(command, "@SiteUserPassword", DbType.String, 50, ParameterDirection.Input, password);

            return dataMiner.GetListData(command);
        }

        public static DataTable GetSiteUserByLoginInfo(string username, string password)
        {
            object id = null;
            DataMiner dataMiner = DataFactory.GetDataMiner();
            DbCommand command = DataFactory.GetCommand();
            command.CommandText = "CSP_GetUserByLoginInfo";
            dataMiner.AddParameter(command, "@SiteUserName", DbType.String, 50, ParameterDirection.Input, username);
            dataMiner.AddParameter(command, "@SiteUserPassword", DbType.String, 50, ParameterDirection.Input, password);

            return dataMiner.GetListData(command);
        }
    }
}
